package com.chaosj.skill.guava.basic

import com.google.common.base.Functions

/**
 * @Description:
 * @author: caoyangjie
 * @date: 2019年11月2019/11/26日 11:32
 * @Copyright: © 赢时胜
 */
class GuavaFunctions {
    static void main(args){
        Map<String,String> map = new HashMap<>()
        map.put("1","1")
        map.put("2","2")
        map.put("3","3")
        map.put("4","4")
        map.put("5","5")

        println(Functions.forMap(map,null).apply("5"))
        println(Functions.forMap(map).apply("1"))
        println(Functions.forMap(map,null).apply("6"))
//        println(Functions.forMap(map).apply("6"))
        println(Functions.compose(Functions.forMap(map),Functions.forMap(map,"3")).apply("8"))
    }
}
